<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
include_once("../../config.inc.php");

include_once(__Language_Path."/selectlanguage_admin.php");
include_once(__Admin_Path."/logincheck_admin_listdata.php");
include_once(__Modules_Path."/WagerList.lib.php");
include_once(__Modules_Path."/ChangeTime.lib.php");
include_once(__Common_Path."/Lotto.inc.php");
$intLID = (int)$_data["LottoID"];
$arrLotto = $_arrLotto[$intLID];

$strSQL = "select ID, GameDate, GameTime, SerialNo from `bet_Gamble` where LottoID = ".$intLID." and EndGameTime > CURRENT_TIME() and GameDate = CURRENT_DATE() order by ID desc limit 0,1";
if(!$RS = PMA_mysql_query($strSQL, $$_Conn))ErrMsgOutputHTML("Error", "", 1);
if(PMA_mysql_num_rows($RS) == 0)ErrMsgOutputHTML("Error", "", 1);
$Rows = PMA_mysql_fetch_object($RS);
$strGDate = DateForm($Rows -> GameDate, $Rows -> GameTime);
$strGTime = TimeForm($Rows -> GameDate, $Rows -> GameTime);

$strFile = __FCommon_Path."/StartGame/StartData".$intLID."_0.xml";

$arrPower = CheckUsePower("realbet3d");
if($arrPower === false)ErrMsgOutputHTML("Error", "", 1);

$strCon = getWagerStartGameList_XMLform($Rows -> ID, $_SESSION["Admin_Info"] -> ID, $arrPower[1], $isStop);

$strCon = str_replace("{Charset}", $_Charset, $strCon);
$strCon = str_replace("{GameDate}", $strGDate, $strCon);
$strCon = str_replace("{GameTime}", $strGTime, $strCon);
$strCon = str_replace("{GameNo}", $Rows -> SerialNo, $strCon);
while(list($k, $v) = each($_arrBet_Type[$arrLotto["LType"]])){
	$strCon = str_replace("{B_".$k."}", $v, $strCon);
}
print $strCon;
@mysql_close($$_Conn);
?>